SetDlgItemText(ID_setopt,LANG(LANG_G40)); // "DÈfinir les options..");
//SetDlgItemText(IDC_mirtitle2,LANG(LANG_G42)); // "Nom du projet");
SetDlgItemText(IDC_login2,LANG_G43);
//SetDlgItemText(IDC_urls,LANG_G44);
SetDlgItemText(IDC_STATIC_webaddr,LANG_G44);
SetCombo(this,IDC_todo,LISTDEF_10);
}
// inits
LAST_ACTION = m_ctl_todo.GetCount()-1; // dernier item (update)
// fichier ini
// lire default
if (first_time) {
first_time=0;
//SetDlgItemText(IDC_INFOMAIN,"Please select an action, and fill the addresse(s) in the URL box.\x0d\x0aThe mirror will be saved in the location indicated below");
/*
CString strSection = "DefaultValues";
CWinApp* pApp = AfxGetApp();
CString st;
int n;
*/
/*
if ((n = pApp->GetProfileInt(strSection, "Action",CB_ERR)) != CB_ERR)
m_ctl_todo.SetCurSel(n);
if ((st = pApp->GetProfileString(strSection, "Depth")))
SetDlgItemText(IDC_depth,st);
*/
/*
if ((st = pApp->GetProfileString(strSection, "MirrorPath","default")) != (CString) "default")
SetDlgItemText(IDC_pthmir,st);
if ((st = pApp->GetProfileString(strSection, "LogPath","default")) != (CString) "default")
// TODO: Add your control notification handler code here
GetDlgItemText(IDC_URL,st);
tempo=(char*) malloc(st.GetLength()+1);
ch=(char*) malloc(st.GetLength()+1);
str=(char*) malloc(st.GetLength()*2+8192);
tempo[0]=ch[0]=str[0]='\0';
if ( (tempo) && (ch) && (str) ) {
strcpybuff(tempo,st);
int i;
for(i=0;i < (int) strlen(tempo);i++) {
if(tempo[i]==10) tempo[i]=' ';
else if(tempo[i]==13) tempo[i]=' ';
}
strcpybuff(ch,"");
int j=0;
for(i=0;i <= (int) strlen(tempo);i++) {
if ((tempo[i]==' ') || (tempo[i]==0)) {
ch[j++]='\0';
if ((strlen(ch)>0) && ((int) strlen(ch)<HTS_URLMAXSIZE) ) {
// vÈrifier URL
/*
char adr[HTS_URLMAXSIZE*2],fil[HTS_URLMAXSIZE*2];
adr[0]=fil[0]='\0';
if (ident_url_absolute(ch,adr,fil)==-1) {
htsblk r;
char loc[HTS_URLMAXSIZE*2]; loc[0]='\0'; // Èventuelle nouvelle position
r=http_test(ch,fil,loc);
if ((r.statuscode==301)
|| (r.statuscode==302)
|| (r.statuscode==303)
|| (r.statuscode==307)
|| (r.statuscode==200)
) {
strcpybuff(ch,loc);
}
}
*/
// recopier adresse
if (strstr(ch,":/")==NULL) {
strcatbuff(str,"http://");
}
strcatbuff(str,ch);
strcatbuff(str,"\x0d\x0a");
}
j=0;
} else ch[j++]=tempo[i];
}
SetDlgItemText(IDC_URL,str);
free(tempo);
free(ch);
free(str);
} else
AfxMessageBox(LANG(LANG_DIAL10));
//m_urls=str;
}
void Wid1::OnChangeUrl()
{
CString st="";
//char tempo[8192];
char* tempo;
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CPropertyPage::OnInitDialog()
// function to send the EM_SETEVENTMASK message to the control
// with the ENM_CHANGE flag ORed into the lParam mask.
// TODO: Add your control notification handler code here
GetDlgItemText(IDC_URL,st);
tempo=(char*) malloc(st.GetLength()+1);
if (tempo) {
strcpybuff(tempo,st);
int ex=0;
do {
if (strlen(tempo)>0) {
switch (tempo[strlen(tempo)-1]) {
case 10: case 13: case 32: tempo[strlen(tempo)-1]='\0';
break;
default: ex=1;
break;
}
} else ex=1;
} while(!ex);
if ( ((strlen(tempo)>0) ) != url_status) { // || (m_ctl_todo.GetCurSel()==4)
url_status=!url_status;
if (url_status) {
//m_ctl_next.ModifyStyle(WS_DISABLED,0);
}
else {
//m_ctl_next.ModifyStyle(0,WS_DISABLED);
}
//m_ctl_next.RedrawWindow();
}
free(tempo); tempo=NULL;
} else
AfxMessageBox(LANG(LANG_DIAL10));
}
void Wid1::Refresh() {
OnChangeUrl();
//OnChangeprox(); // update disabled/normal
//OnSelchangedepth(); // update disabled/normal
}
void Wid1::OnSelchangetodo()
{
int r;
r = m_ctl_todo.GetCurSel();
if (r!=CB_ERR) {
switch(r) {
case 0:
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G2 /*"Mirror mode, fill the addresse(s) in the URL box.\x0d\x0aThe mirror will be saved in the location indicated below",
"Mode miroir, remplissez les addresse(s) dans la liste d'URLs.\x0d\x0aLe mirroir sera sauvÈ ‡ l'emplacement indiquÈ plus bas"*/)
);
break;
case 1:
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G3 /* "Mirror mode with wizard (asks questions), fill the addresse(s) in the URL box.\x0d\x0aThe mirror will be saved in the location indicated below",
"Mode miroir semi automatique (pose des questions), remplissez les addresse(s) dans la liste d'URLs.\x0d\x0aLe mirroir sera sauvÈ ‡ l'emplacement indiquÈ plus bas"*/)
);
break;
case 2:
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G4 /* "Get files mode, fill the addresse(s) of the files in the URL box.\x0d\x0aThe mirror will be saved in the location indicated below",
"Mode tÈlÈchargement de fichier, remplissez les addresse(s) des fichiers dans la liste d'URLs.\x0d\x0aLe mirroir sera sauvÈ ‡ l'emplacement indiquÈ plus bas"*/)
);
SetDlgItemText(IDC_depth,"");
break;
case 3:
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G1B)
);
SetDlgItemText(IDC_depth,"");
break;
case 4:
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G5 /* "Test links mode, fill the addresse(s) of the pages containing links to test in the URL box.\x0d\x0aThe log report will be saved in the location indicated below",
"Mode test de liens, remplissez les adresse(s) des pages contenant les liens ‡ tester dans la liste d'URLs.\x0d\x0aLes fichiers d'audit seront sauvÈs ‡ l'emplacement indiquÈ plus bas"*/)
);
SetDlgItemText(IDC_depth,"");
break;
default:
if (r == LAST_ACTION )
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G6 /* "Update/Continue a mirror mode, check addresse(s) in the URL box, then click to the 'NEXT' button and check parameters.\x0d\x0aThe mirror will be saved in the location indicated below",
"Mode mise ‡ jour/continuer un miroir, vÈrifiez les adresse(s) dans la liste d'URLs, puis cliquez sur le bouton 'NEXT' et vÈrifiez les paramËtres.\x0d\x0aLe mirroir sera sauvÈ ‡ l'emplacement indiquÈ plus bas"*/)
);
else if (r == LAST_ACTION-1 )
SetDlgItemText(IDC_INFOMAIN,
LANG(LANG_G6b /* "Update/Continue a mirror mode, check addresse(s) in the URL box, then click to the 'NEXT' button and check parameters.\x0d\x0aThe mirror will be saved in the location indicated below",
"Mode mise ‡ jour/continuer un miroir, vÈrifiez les adresse(s) dans la liste d'URLs, puis cliquez sur le bouton 'NEXT' et vÈrifiez les paramËtres.\x0d\x0aLe mirroir sera sauvÈ ‡ l'emplacement indiquÈ plus bas"*/)
);
break;
}
if ( ((r==LAST_ACTION)||(r==LAST_ACTION-1)) != continue_status) {